/**
 * @file Multigrid_Factory.h
 * @brief Factory mode for Multigrid solver.
 * @author Linhuo (1066117119@qq.com)
 * @version 1.0
 * @date 2021-06-09
 * 
 * @copyright Copyright (c) 2021  Linhuo
 * 
 */
#ifndef _PRO2_MULTIGRID_FACTORY_H_
#define _PRO2_MULTIGRID_FACTORY_H_
#include "Multigrid_Solver.h"
#include "Multigrid_Solver_1D.h"
#include "Multigrid_Solver_2D.h"

/**
 * @brief A Factory base for MGSolver.
 */
class FactoryMGSolverBase
{
public:
    virtual Multigrid_Solver *CreateMGSolver()=0;
};

/**
 * @brief A Create_1D_MG_Solver helper.
 */
class Factory1DMGSolver : public FactoryMGSolverBase
{
public:
    Multigrid_Solver *CreateMGSolver()
    {
        return new MG_1D;
    };
};

/**
 * @brief A Create_2D_MG_Solver helper.
 */
class Factory2DMGSolver : public FactoryMGSolverBase
{
public:
    Multigrid_Solver *CreateMGSolver()
    {
        return new MG_2D;
    };
};

#else
//DO NOTHING
#endif